﻿using ExportTool;
using System;
using System.Collections.Generic;
using System.IO;

namespace ExportAsync
{
    internal class Program
    {
        static void Main(string[] args)
         {
            string currentDirectory = Directory.GetCurrentDirectory();
            string rootDirectory = Path.GetPathRoot(currentDirectory);
            ExcelExport excelExport = new ExcelExport();
            List<ExportStyle> damos = new List<ExportStyle>();
            damos.Add(new ExportStyle
            {
                Name = "Test",
                Description = "Test",
                CreateTime = DateTime.Now,
            });
            damos.Add(new ExportStyle
            {
                Name = "Test1",
                Description = "Test1",
                CreateTime = DateTime.Now,
            });
            excelExport.ExportExcelLocal<ExportStyle>(damos, rootDirectory, ExportFunc, "测试");
        }

        public static void ExportFunc(int x, CallbBackOBJ res)
        {
            if (x != 0)
            {
                Console.WriteLine("表格导出成功！");
                Console.WriteLine($"文件名{res.FileName}");
            }


        }
    }

}
